//
//  KWMBaseModel.m
//  iXiaoWeiOA
//
//  Created by kevin on 3/14/15.
//  Copyright (c) 2015 kollway. All rights reserved.
//

#import "KWMBaseModel.h"
#import "KWMStringUtil.h"

@implementation KWMBaseModel

+ (BOOL)propertyIsOptional:(NSString *)propertyName {
    return YES;
}

+(JSONKeyMapper*)keyMapper {
    return [JSONKeyMapper mapperFromUnderscoreCaseToCamelCase];
}

- (NSString *)toJSONString {
    //弱类型的Objective-C就是这么ugly
    self.createTime = @(self.createTime.longLongValue);
    self.updateTime = @(self.updateTime.longLongValue);
    return [super toJSONString];
}


- (BOOL)isValidated {
    return self.id && self.id.integerValue > 0;
}


@end
